<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2018/1/19 0019
 * Time: 08:55
 */
?>

<!-- Modal -->
<div class="modal fade modal-focus" id="myModalLabel" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
    <div class="modal-dialog2" role="document">
        <div class="modal-content">
            <div class="modal-body">
                <div class="modal-body-focus">
                    <img src="/image/assetPackage/smile.png">
                    <p class="focus">关注成功</p>
                    <p>有更新系统会第一时间通知您</p>
                </div>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-primary btns-primary" data-dismiss="modal">确定</button>
            </div>
        </div>
    </div>
</div>
<!-- 模态窗口  结束!!!!!!!!!!!!!!!!!!!!!!!!!!! -->


<!-- textarea 高度设置对比div -->
<div style="max-height: 1px; overflow: hidden;">
    <div id="d1" style="visibility:hidden" class="one-txt-cut"></div>
</div>





<?php
$cssString = <<<CSS
.edit-tabs-li1>a {
    display: inline-block;
    width: 108px;
    height: 40px;
}


.layui-layer-title {
	color: #fff!important;
	font-weight: bolder!important;
     font-size: 16px!important;
}

.layui-layer-title {
	background: #4da1ff!important;
}

.layui-layer-ico {
    background: url(/image/assetPackage/close.png) no-repeat!important;
}
.box-body {
	margin-top:18px!important;
}
.select2-container .select2-selection--single {
    height: 40px;
}
CSS;
$this->registerCss($cssString);
?>

<script type="text/javascript" src="/js/jquery.fixedheadertable.js"></script>
<script type="text/javascript" src="/js/index.js"></script>
<script type="text/javascript" src="/js/paging.js"></script>
<script type="text/javascript" src="/js/jquery.validate.min.js"></script>
<script type="text/javascript" src="/js/jquery.validate.extend.js"></script>
<script type="text/javascript" src="/js/messages_zh.js"></script>
<script type="text/javascript" src="/js/select2.min.js"></script>
<script type="text/javascript" src="/js/AssetPackageDetails.js"></script>
<script type="text/javascript" src="/js/packageinfo.js"></script>
<script type="text/javascript" src="/js/packageInvestigation.js"></script>
<script type="text/javascript" src="/js/packageAudit.js"></script>


<!-- jQuery (necessary for Bootstrap's JavaScript plugins) -->
<!--<script src="https://cdn.bootcss.com/jquery/1.12.4/jquery.min.js"></script>-->
<!-- Include all compiled plugins (below), or include individual files as needed -->
<!-- 最新的 Bootstrap 核心 JavaScript 文件 -->
<!--<scriptsrc="https://cdn.bootcss.com/bootstrap/3.3.7/js/bootstrap.min.js"integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa" crossorigin="anonymous"></script>-->

<script>
    var package_id = '<?= $data["id"] ?>';
    $(".like").on('click', function () {
        var value = $(this).attr('data').split('-');
        var url = '/package/set-package-like';
        if (value[2] == 2) {
            url = '/package/set-project-light';
        }
        $.get(url, {'package_id': package_id, 'del': value[1], 'type': value[2]}, function (res) {
            if (res.status) {
                $("#" + value[0] + "_img").attr('src', res.img);
                $("#" + value[0]).attr('data', value[0] + '-' + res.type + '-' + value[2]);
                if (res.type == 1 && value[2] == 1) {
                    $("#flow .pull-left").html("已关注");
                    $('#myModalLabel').modal('show');
                } else {
                    $("#flow .pull-left").html("关注");
                    layer.msg(res.msg);
                }
            } else {
                layer.msg(res.msg);
            }
        });
    });

    $("#asJump").click(function () {
        var package_id = '<?= $data["id"] ?>';
        layer.open({
            type: 2,
            title: '修改协同',
            shadeClose: false,
            shade: 0,
            area: ['800px', '90%'],
            content: ['/package-initiation-plan/get-package-plan1?package_id=' + package_id], //iframe的url
            success: function (layero, index) {
//                                var index = parent.layer.getFrameIndex(window.name);
//                                layer.close(index)
                layer.iframeAuto(index);
            }
        });
    })
    $("#lixiang").click(function () {
        var package_id = '<?= $data["id"] ?>';
        $.get('/package-apply/judge-package', {'package_id': package_id}, function (data) {
            $("#AssetPackageEditing-approval").html(data);
        })
    })

    $(function () {
//        $('#myTable1').fixedHeaderTable({altClass: 'odd', footer: true, fixedColumns: 4});
//        $('#myTable2').fixedHeaderTable({altClass: 'odd', footer: true, fixedColumns: 4});
        //        $("#projectListBase,#projectListBase2").find("a").addClass("txt-cut");
//        $("#projectListBase,#projectListBase2").find("span").addClass("txt-cut");
//        $("#projectListBase,#projectListBase2").find("input").addClass("txt-cut");

        // 4.项目清单表头地区和本金点击切换效果
        $("#Area,#Principal").click(function () {
            if ($(this).find("span").hasClass("glyphicon-triangle-bottom")) {
                $(this).find("span").removeClass("glyphicon-triangle-bottom").addClass("glyphicon-triangle-top");
            } else {
                $(this).find("span").removeClass("glyphicon-triangle-top").addClass("glyphicon-triangle-bottom");
            }
        });
    })
</script>
<script type="text/javascript">
    $(function(){
        $("#infoForm").validate();
        $("#transferForm").validate();
        $("#addProject").validate();

    });
</script>